import request from '@/utils/request'

// 分页查询
export function query(data) {
  return request({
    url: `/md/monopy/qualityCheckList/query`,
    // url: `/md/monopy/qualityCheckList/query`,
    method: 'post',
    data
  })
}

// 获取详情
export function queryById(id) {
  return request({
    url: `/md/monopy/qualityCheckList/${id}`,
    method: 'get'
  })
}

// 删除
export function remove(id) {
  return request({
    url: `/md/monopy/qualityCheckList/delete`,
    method: 'delete'
  })
}

// 批量删除
export function batchRemove(data) {
  return request({
    url: `/md/monopy/qualityCheckList/deleteList`,
    method: 'delete',
    data
  })
}

// 保存
export function save(data) {
  return request({
    // BaseURL:'',
    // url: `http://localhost:19004/monopy/qualityCheckList/save`,
    url: `/md/monopy/qualityCheckList/save`,
    method: 'post',
    data
  })
}

// 生成检验编码
export function generalCode() {
  return request({
    url: `/md/monopy/qualityCheckList/getCheckCode`,
    method: 'get'
  })
}

// 预览
export function previewFile(filePath) {
  return request({
    url: `/md/monopy/qualityCheckList/preview?filePath=${filePath}`,
    method: 'get'
  })
}

// 获取默认版本的计划编号
export function getPlanCode() {
  return request({
    url: `/md/monopy/qualityPlans/getDefaultPlan`,
    method: 'GET'
  })
}

// 获取批次下的所有工序分页
export function queryQuaOperation(data) {
  return request({
    url: `/md/monopy/qualityCheckList/getOperationBySfc`,
    method: 'POST',
    data
  })
}

// 获取点检项和检验单信息
export function queryQuaInfo(data) {
  return request({
    // BaseURL:'',
    // url: `http://localhost:19004/monopy/qualityCheckList/getQcoVOBySfcOperation`,
    url: `/md/monopy/qualityCheckList/getQcoVOBySfcOperation`,
    method: 'POST',
    data
  })
}

// 批量品检修改字段
export function batchChecked(data) {
  return request({
    url: `/md/monopy/qualityCheckList/batchModification`,
    method: 'POST',
    data
  })
}
